// 导入express
const express = require('express')
// 创建路由对象
const router =express.Router()

// 导入商品的路由处理函数模块
const goodsList_handler = require('../router_handler/goods')

// 搜索商品的路由
router.post('/getGoodsList',goodsList_handler.getGoodsList)
//获取商品
router.post('/getAllGoods',goodsList_handler.getAllGoods)
//根据分类获取商品
router.post('/getGoodsListByCategory',goodsList_handler.getGoodsListByCategory)
//点击商品详情的路由
router.get('/getGoodsDetail/:id',goodsList_handler.getGoodsDetail)

// //上架商品的的路由
router.post('/saleGoods',goodsList_handler.saleGoods)
//下架商品的的路由
router.post('/cancelGoods',goodsList_handler.cancelGoods)
//删除商品的的路由
router.delete('/deleteGoods/:id',goodsList_handler.deleteGoods)
//上传图片的的路由
router.post('/uploadImg',goodsList_handler.uploadImg)
//上传商品的的路由
router.post('/addGoods',goodsList_handler.addGoods)
//更新商品的的路由
router.post('/updateGoods',goodsList_handler.updateGoods)
//后台获取商品信息的路由
router.get('/getGoodsById/:id',goodsList_handler.getGoodsById)

// 向外共享路由对象
module.exports = router